﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace Cloak.Mvp
{
	/// <summary>
	/// The point at which a presenter is bound to a particular view instance
	/// </summary>
	public class PresenterSite
	{
		/// <summary>
		/// Initializes a site with the specified presenter type and view
		/// </summary>
		/// <param name="presenterType">The type of presenter which handles the view</param>
		/// <param name="view">The view instance which is handled by the presenter</param>
		public PresenterSite(Type presenterType, object view)
		{
			Contract.Requires(presenterType != null);
			Contract.Requires(view != null);

			PresenterType = presenterType;
			View = view;
		}

		/// <summary>
		/// Gets the type of presenter which handles the view
		/// </summary>
		public Type PresenterType { get; private set; }

		/// <summary>
		/// Gets the view instance which is handled by the presenter
		/// </summary>
		public object View { get; private set; }
	}
}